<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>authorization code</title>
</head>

<body>
<div>
    <h1>授权码模式（authorization code）</h1>
</div>

<div>
    <h2>流程图</h2>
    <img src="../img/wf_authorization_code.png">
</div>

<div>
    <h2>举个例子</h2>

    <ol>
        <li>
            <h3>我是客户端，请前往认证服务器为我授权</h3>
            <a href="//localhost:8880/authorization/oauth/authorize?response_type=code&client_id=myClientId&redirect_uri=//localhost:8882/defender/auth/code"
               target="_blank" id="id_auth_server_url">去授权</a>
        </li>
        <li>
            <h3>认证服务器要求使用用户名和密码登录，然后指定授权范围</h3>
        </li>
        <li>
            <h3>认证服务器生成授权码并让浏览器跳转到指定的跳转地址</h3>
        </li>
        <li>
            <h3>客户端收到授权码，向认证服务器申请Token</h3>
        </li>
        <li>
            <h3>客户端收到Token，向资源服务器申请资源</h3>
        </li>
    </ol>
</div>
</body>

<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../js/authorization_code.js"></script>
</html>
